<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue-demo</title>
</head>
<style>
    div {
        margin-bottom: 30px;
        text-align: center;
    }
</style>
<body>
    <div id="app">
        <div>{{ title }}</div>
        <div v-text="value"></div>
        <div>
            <input v-model="value" type="text">
        </div>
        <div>
            <h3>v-on实现</h3>
            <button v-on:click="add">add Count</button>
            <span>{{ count }}</span>
        </div>
        <div>
            <h3>v-html</h3>
            <div v-html="htmlText"></div>
        </div>
    </div>
</body>
<script src="./js/vue.js"></script>
<script src="./js/observer.js"></script>
<script src="./js/compiler.js"></script>
<script src="./js/dep.js"></script>
<script src="./js/watcher.js"></script>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            title: 'Hello Vue',
            person: {
                name: 'pb',
                age: 18
            },
            value: 'abc',
            count: 0,
            htmlText: '<div>haha, I am htmlString<h5>I\'m subString</h5></div>'
        },
        methods: {
            add() {
                this.count++;
            }
        }
    })
</script>
</html>